home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 43 / Amiga Format CD43 (1999)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1999-09].iso / -in_the_mag- / workbench / sql / sqldb / rexxmacros / sqltest2.rexx < prev    next >
OS/2 REXX Batch file  |  1999-06-29  |  1KB  |  50 lines

  1. /* sqltest.rexx */
  2. options results
  3. address 'SQLserver'
  4. say 'Got Server'
  5. 'ExecSQL' "open table salesreps;"
  6. 'ExecSQL' "declare testcur cursor for select from salesreps;"
  7. 'ExecSQL' "open testcur;"
  8.  
  9. say 'About to fetch 1'
  10. 'ExecSQL' "fetch next of testcur;"
  11. say 'fetch_buf = ' result
  12. 'GetLastCode'
  13. say 'sqlca.sqlcode = ' result
  14.  
  15. say 'About to fetch 2'
  16. 'ExecSQL' "fetch next of testcur;"
  17. say 'fetch_buf = ' result
  18. 'GetLastCode'
  19. say 'sqlca.sqlcode = ' result
  20.  
  21. say 'About to fetch 3'
  22. 'ExecSQL' "fetch next of testcur;"
  23. say 'fetch_buf = ' result
  24. 'GetLastCode'
  25. say 'sqlca.sqlcode = ' result
  26.  
  27. say 'About to fetch 4'
  28. 'ExecSQL' "fetch next of testcur;"
  29. say 'fetch_buf = ' result
  30. 'GetLastCode'
  31. say 'sqlca.sqlcode = ' result
  32.  
  33. say 'About to fetch 5'
  34. 'ExecSQL' "fetch next of testcur;"
  35. say 'fetch_buf = ' result
  36. 'GetLastCode'
  37. say 'sqlca.sqlcode = ' result
  38.  
  39. say 'About to fetch absolute 7'
  40. 'ExecSQL' "fetch absolute 7 of testcur;"
  41. say 'fetch_buf = ' result
  42. 'GetLastCode'
  43. say 'sqlca.sqlcode = ' result
  44. 'GetLastErrMsg'
  45. say 'errmsg = ' result
  46.  
  47. 'ExecSQL' "close testcur;"
  48. 'ExecSQL' "close table salesreps;"
  49.  
  50.